#!/bin/bash
wget rz.muc.edu.cn/srun_portal_pc_success.php>/dev/null 2>&1
ip=$(cat srun_portal_pc_success.php |grep user_ip|sed 's/.*value="//'|sed 's/".*//')
username=$(cat srun_portal_pc_success.php |grep username|sed 's/.*value="//'|sed 's/".*//')
flow=$(cat srun_portal_pc_success.php |grep "<span class=\"color1\">"|tail -n +2|head -n 1|sed 's/.*color1">//'|sed 's/<.*//')
cash=$(cat srun_portal_pc_success.php |grep "<span class=\"color1\">"|tail -n +4|head -n 1|sed 's/.*color1">//'|sed 's/<.*//'|sed 's/.*\([0-9]\+\)\./\1./')
rm -f srun_portal_pc_success.php*
if [ -z "$username" ]
then
	echo "Status: Not logged!"	
else
	echo "Status: Logged!"
	echo "Flow  : $flow"
	echo "Cash  : $cash"
fi
